<% if can? :read, Comment%>
	<h1>ความคิดเห็น: <%= @profile.comments.size%></h1>
	<div id="comments">
		<% unless @profile.comments.empty? %>

			<% for comment in @profile.comments %>
				<div class="comment">
					<% if comment.profile.has_image?%>
						<%= image_tag_for(comment.profile, :thumb => :comment, :class => "img")%>
					<%end%>

					<strong><%= h(comment.title)%> </strong>
					<div class="mod"
						<% if can? :update, comment %>
							<%= link_to "แก้ไข", edit_account_comment_path(comment) %>
						<% end %>
						<% if can? :destroy, comment %>
							| <%= link_to "ลบทิ้ง", account_comment_path(comment), :method => :delete, :confirm => "Are you sure?"%>
						<% end %>
					</div>
					<%=simple_format comment.comment %>
					<p>
					โดย<strong><i> <%= h(comment.profile ?  comment.profile.user.login : "none") %></i></strong>
					<em>on <%= comment.created_at.strftime('%b %d, %Y at %H:%M') %></em>
					</p>
				</div>
			<% end %>
		<% else %>
			<b><center>"No comment on this user"</center></b>
		<% end %>

		<% if current_user.profile != @profile%>
			<% if can? :create, Comment%>
				<b>เพิ่มความคิดเห็น:<b>
						<%= render :partial => 'comments/form' %>
			<%end%>
		<%end%>
	</div>
<%end%>
